import { Controller, Get, Post, Body, Patch, Param, Delete, UseGuards } from '@nestjs/common'
import { SettingService } from './setting.service'
import { CreateSettingDto } from './dto/create-setting.dto'
import { UpdateSettingDto } from './dto/update-setting.dto'
import { AuthGuard } from '@nestjs/passport'

@Controller('setting')
@UseGuards(AuthGuard('jwt'))
export class SettingController {
    constructor(private readonly settingService: SettingService) { }

    @Post()
    create(@Body() createSettingDto: CreateSettingDto) {
        return this.settingService.create(createSettingDto);
    }

    @Get()
    findAll() {
        return this.settingService.findAll();
    }

    @Get(':id')
    findOne(@Param('id') id: string) {
        return this.settingService.findOne(+id);
    }

    @Patch(':id')
    update(@Param('id') id: string, @Body() updateSettingDto: UpdateSettingDto) {
        return this.settingService.update(+id, updateSettingDto);
    }

    @Delete(':id')
    remove(@Param('id') id: string) {
        return this.settingService.remove(+id);
    }
}
